Skip to content

Conversation

@Avinash1423
Copy link
Contributor

#87

Added a method getMotherBoardName and getInterfaceType methods in Util.java .
These methods are sensitive to platform.

Mother Board Name is displayed along w cpu info in title area
Interface Type is diplayed along with disk info

Signed-off-by: Avinash Niyas <avinashNiyaz1423@gmail.com>
@Avinash1423
Copy link
Contributor Author

@jamesmarkchan pls take a look at the PR.


line=line.trim();

if(line.isEmpty()) { continue;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor but if you could add spaces around the keywords like if to avoid others formatting your code and you don't loose the line authorship. same with the = assignment operator and before the {. :)


try {
if (App.os.startsWith("Windows")) {
process = new ProcessBuilder("wmic", "diskdrive", "get", "InterfaceType").start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have three disk on my system and got this:

image

I think you'd need to get the drive letter to map a drive to it's interface. I wonder if we would be able to tell between scsi and m2 or scis and pcie4/pcie5. I have x3 gen 4 pcie m2 drives.


if(line.isEmpty()) { continue;}

if(line.equalsIgnoreCase("InterfaceType") || line.equalsIgnoreCase("TRAN")|| line.equalsIgnoreCase("NAME")) { continue;}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I've found helpful for code reviews and future maintenance is to show the normal output of the command being used in the java docs or comments. I'm definitely interested in collecting more information on the drives interface so happy to see you are looking at this. worth looking at disk-model.ps1 to see how the drive and target attribute column can be queried in order to create the mapping. might be able to do it with command line also. @jslcom might have thoughts on the linux solutions.


try {
if (App.os.startsWith("Windows")) {
process = new ProcessBuilder("wmic", "baseboard", "get", "Product").start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got this

image

} else if (App.os.contains("Linux")) {
process = new ProcessBuilder("cat", "/sys/devices/virtual/dmi/id/board_name").start();
} else if (App.os.startsWith("Mac OS")) {
process = new ProcessBuilder("system_profiler", "SPHardwareDataType").start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got this

image

} else if (App.os.contains("Linux")) {
process = new ProcessBuilder("lsblk", "-d", "-o", "tran").start();
} else if (App.os.startsWith("Mac OS")) {
process = new ProcessBuilder("diskutil", "info", "disk0").start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what the output looks like, not sure I see the interface.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants